﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SachOnlineLibrary.Public
{
    public class DonDatHang
    {
        int maPhieu;

        public int MaPhieu
        {
            get { return maPhieu; }
            set { maPhieu = value; }
        }
        int tkid;

        public int TKID
        {
            get { return tkid; }
            set { tkid = value; }
        }
        DateTime ngayDatHang;

        public DateTime NgayDatHang
        {
            get { return ngayDatHang; }
            set { ngayDatHang = value; }
        }
        long tongTien;

        public long TongTien
        {
            get { return tongTien; }
            set { tongTien = value; }
        }
        string trangThai;

        public string TrangThai
        {
            get { return trangThai; }
            set { trangThai = value; }
        }
        string diaChi;

        public string DiaChi
        {
            get { return diaChi; }
            set { diaChi = value; }
        }
        
        string ngayGiaoHang;

        public string NgayGiaoHang
        {
            get { return ngayGiaoHang; }
            set { ngayGiaoHang = value; }
        }
        string tenNguoiNhan;

        public string TenNguoiNhan
        {
            get { return tenNguoiNhan; }
            set { tenNguoiNhan = value; }
        }
        string soDienThoai;

        public string SoDienThoai
        {
            get { return soDienThoai; }
            set { soDienThoai = value; }
        }

        private List<ChiTietDatHang> listChiTietDatHang;

        public List<ChiTietDatHang> ListChiTietDatHang
        {
            get { return listChiTietDatHang; }
            set { listChiTietDatHang = value; }
        }
        private TaiKhoan taiKhoan;

        public TaiKhoan TaiKhoan
        {
            get { return taiKhoan; }
            set { taiKhoan = value; }
        }
        public void ChuyenDoi(System.Data.DataRow dr)
        {
            MaPhieu = int.Parse(dr[0].ToString());
            TKID = int.Parse(dr[1].ToString());
            NgayDatHang = DateTime.Parse(dr[2].ToString());
            TongTien = long.Parse(dr[3].ToString());
            TrangThai = dr[4].ToString();
            DiaChi = dr[5].ToString();
            if (dr[6].ToString() != "")
            {
                NgayGiaoHang = dr[6].ToString();
            }
            else
            {
                NgayGiaoHang = "";
            }
            TenNguoiNhan = dr[7].ToString();
            SoDienThoai = dr[8].ToString();
        }
    }
}
